class Tag implements Comparable {

  static belongsTo = Post
  static hasMany = [posts:Post]

  String name

  static constraints = {
    name(nullable:false, blank:false, size:1..20, unique:true)
  }

  public String toString() {
    return name
  }

    public int compareTo(Object o) {
        return name.compareTo(o.name)
    }
}